/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Engine2D.renderer;

/**
 *
 * @author Garys
 */
public class QuadLineStripRenderer implements LineStripRendererInterface {

    private GLRenderer renderer = Renderer.get();
    private LineStripRenderer lineRenderer = new LineStripRenderer();
    /**
     * 
     */
    public static int MAX_POINTS = 10000;
    private float[] points;
    private float[] colours;
    private int pts;
    private boolean antialias;
    private float width = 1;
    

    /**
     * 
     */
    public QuadLineStripRenderer() {
        points = new float[MAX_POINTS * 2];
        colours = new float[MAX_POINTS * 4];
    }

    /**
     * 
     */
    @Override
    public void start() {
        lineRenderer.start();
    }

    /**
     * 
     */
    @Override
    public void end() {
        if (width == 1) {
            lineRenderer.end();
            return;
        }
        
        
        renderLines(points,pts);
        

    }

    /**
     * 
     * @param x
     * @param y
     */
    @Override
    public void vertex(float x, float y) {
        lineRenderer.vertex(x, y);
    }

    /**
     * 
     * @param red
     * @param green
     * @param blue
     * @param alpha
     */
    @Override
    public void setColour(float red, float green, float blue, float alpha) {
    }

    /**
     * 
     * @param width
     */
    @Override
    public void setWidth(float width) {
        this.width = width;
    }

    /**
     * 
     * @param antialias
     */
    @Override
    public void setAntiAlias(boolean antialias) {
        lineRenderer.setAntiAlias(antialias);
        this.antialias = antialias;
    }

    /**
     * 
     * @param caps
     */
    @Override
    public void setLineCaps(boolean caps) {
    }

    private void renderLines(float[] points, int pts) {
        
        renderLinesImpl(points, pts, width);
    }

    private void renderLinesImpl(float[] points, int pts, float width) {
        
    }
    
    
}
